<%@ page contentType="text/html; charset=utf-8" %>
<%@ include file="/WEB-INF/jsp/includeTaglib.jsp" %>
<table class="dbborder" width="100%" border="0" cellpadding="0" cellspacing="1">
	<tr class="rowHead">
		<td height="20" width="20" align="center"></td>
		<td height="20" nowrap align="center" class="globalTextBold">门店编号</td>
		<td height="20" nowrap align="center" class="globalTextBold">门店名称</td>
		<td height="20" nowrap align="center" class="globalTextBold">地址</td>
		<td height="20" nowrap align="center" class="globalTextBold">行政区域</td>
		<td height="20" nowrap align="center" class="globalTextBold">促销员配额</td>
		<td height="20" nowrap align="center" class="globalTextBold">促销员数量</td>
		<td height="20" nowrap align="center" class="globalTextBold">操作</td>
	</tr>
	<c:forEach var="projectStore" items="${page.data}" varStatus="status">
		<tr class="rowClass">
			<td height="20" width="20" align="center"></td>
			<td height="20" class="globalText">${projectStore.channel_code}</td>
			<td height="20" class="globalText">${projectStore.channel_name}</td>
			<td height="20" class="globalText">${projectStore.channel_address}</td>
            <td>
                <c:choose>
                    <c:when test="${projectStore.channel_province_ad_name=='北京市'}">${projectStore.channel_province_ad_name}-${projectStore.channel_ad_name}</c:when>
                    <c:when test="${projectStore.channel_province_ad_name=='上海市'}">${projectStore.channel_province_ad_name}-${projectStore.channel_ad_name}</c:when>
                    <c:when test="${projectStore.channel_province_ad_name=='天津市'}">${projectStore.channel_province_ad_name}-${projectStore.channel_ad_name}</c:when>
                    <c:when test="${projectStore.channel_province_ad_name=='重庆市'}">${projectStore.channel_province_ad_name}-${projectStore.channel_ad_name}</c:when>
                    <c:otherwise>${projectStore.channel_province_ad_name}-${projectStore.channel_city_ad_name}-${projectStore.channel_ad_name}</c:otherwise>
                </c:choose>
            </td>
			<%--<td height="20" class="globalText">${projectStore.channel_province_ad_name}-${projectStore.channel_city_ad_name}-${projectStore.channel_ad_name}</td>--%>
            <td height="20" class="globalText">${projectStore.required_sales_number}</td>
            <td height="20" class="globalText">${projectStore.assigned_sales_number}</td>
            <td height="20" class="globalText">
				<input type="button" class="btnStyle" value="配置" onclick="javascript:assignSales(${projectStore.id})">
				<input type="button" class="btnStyle" value="删除" onclick="javascript:delProjectStore('${projectStore.project}','${projectStore.id}')">
			</td>
		</tr>
	</c:forEach>
</table>

<%@ include file="/WEB-INF/jsp/includePagination.jsp"%>

<script type="text/javascript">
	function delProjectStore(projectId,projectStoreId){
		if(confirm('确定删除?')){
			window.location='removeProjectStores.html?projectId='+projectId+'&projectStoreId='+projectStoreId;
		}
	}
    function assignSales(projectStoreId) {
        var url='projectStoreAssignSales.html?projectStoreId='+projectStoreId;
        window.showModalDialog('<c:url value="'+url+'"/>',window,'status:no;resizable:no;directories:no;help:no;scroll:no;dialogWidth=300px;dialogHeight=280px;dialogLeft:500px;dialogTop:300px;');
        <%--window.open('<c:url value="'+url+'"/>','_blank','status:no;resizable:no;directories:no;help:no;scroll:no;dialogWidth=300px;dialogHeight=280px;dialogLeft:500px;dialogTop:300px;');--%>
        listDefaultPageAjax('projectStoresListData','projectStoreForm','<c:url value='/project/projectStoresList.html' />');
    }
</script>
